package com.ruoyi.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.order.domain.OrderTicket;
import com.ruoyi.order.mapper.OrderTicketMapper;
import com.ruoyi.order.service.IOrderTicketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 影票订单Service业务层处理
 *
 * @author HHAOYU
 * @date 2020-12-14
 */
@Service
public class OrderTicketServiceImpl extends ServiceImpl<OrderTicketMapper, OrderTicket> implements IOrderTicketService {
    @Autowired
    private OrderTicketMapper orderTicketMapper;

    /**
     * 查询影票订单
     *
     * @param id 影票订单ID
     * @return 影票订单
     */
    @Override
    public OrderTicket selectOrderTicketById(Long id)
    {
        return orderTicketMapper.selectOrderTicketById(id);
    }

    /**
     * 查询影票订单列表
     *
     * @param orderTicket 影票订单
     * @return 影票订单
     */
    @Override
    public List<OrderTicket> selectOrderTicketList(OrderTicket orderTicket)
    {
        return orderTicketMapper.selectOrderTicketList(orderTicket);
    }

    /**
     * 新增影票订单
     *
     * @param orderTicket 影票订单
     * @return 结果
     */
    @Override
    public int insertOrderTicket(OrderTicket orderTicket)
    {
        orderTicket.setCreateTime(DateUtils.getNowDate());
        return orderTicketMapper.insertOrderTicket(orderTicket);
    }

    /**
     * 修改影票订单
     *
     * @param orderTicket 影票订单
     * @return 结果
     */
    @Override
    public int updateOrderTicket(OrderTicket orderTicket)
    {
        orderTicket.setUpdateTime(DateUtils.getNowDate());
        return orderTicketMapper.updateOrderTicket(orderTicket);
    }

    /**
     * 批量删除影票订单
     *
     * @param ids 需要删除的影票订单ID
     * @return 结果
     */
    @Override
    public int deleteOrderTicketByIds(Long[] ids)
    {
        return orderTicketMapper.deleteOrderTicketByIds(ids);
    }

    /**
     * 删除影票订单信息
     *
     * @param id 影票订单ID
     * @return 结果
     */
    @Override
    public int deleteOrderTicketById(Long id)
    {
        return orderTicketMapper.deleteOrderTicketById(id);
    }
}
